package com.learn.dubbo.client;

import com.learn.dubbo.services.UserService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * @author wangxing
 * @version 2020/6/8 14:18 Administrator
 */
public class SpringClient {
    public static void main(String[] args) throws IOException {


        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
        while (true) {
            if ("quit".equals(bufferedReader.readLine())) {
                break;
            }
            ClassPathXmlApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext(
                    "consumer.xml");
            UserService userService = classPathXmlApplicationContext.getBean(UserService.class);
            System.out.println(userService.getUser(1));

        }
    }
}
